﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Authentication;
using System.Web.Http;
using Gfinder.Data.Repositories.Garages;
using Gfinder.Domain.Models.Garages;
using Gfinder.Domain.Repositories.Garages;
using Gfinder.Domain.Services.Garages;

namespace Gfinder.Api.Controllers
{
    public class GarageController : ApiController
    {
        private readonly IGarageService _garageService;

        public GarageController(IGarageService garageService)
        {
            _garageService = garageService;
        }

        public List<Garage> Get()
        {
            throw new AuthenticationException("aaaa");

            //var garage = new Garage
            //{
            //    Id = Guid.NewGuid(),
            //    Name = "Garage 1"
            //};

            //_garageRepository.Insert(garage);

            var garages = _garageService.FindAll();

            return garages;
        }
    }
}
